#include <iostream>
using namespace std;

int main() {
    int n = 0;
    int count = 0;
    cin >> n;

    for(size_t i = 0; i < 32; i++){
        int cur_count = 0;
        while(((n >> i) & 1) == 1){
            cur_count++;
            i++;
        }
        if(cur_count > count)
            count = cur_count;
    }

    cout << count << endl;
    return 0;
}